package day06_homework_2;

import java.util.Scanner;

public class Calculator {

	public static void main(String[] args) {
		Number number = new Number();
		Scanner input = new Scanner(System.in);
		while (true) {
			System.out.println("请选择需要的运算：");
			System.out.println("1:加法");
			System.out.println("2:减法");
			System.out.println("3:乘法");
			System.out.println("4:除法");
			int choose = input.nextInt();
			switch (choose) {
			case 1:
				System.out.println("请输入两个加数：");
				System.out.println(number.add(input.nextDouble(), input.nextDouble()));
				break;
			case 2:
				System.out.println("请输入两个减数：");
				System.out.println(number.sub(input.nextDouble(), input.nextDouble()));
				break;
			case 3:
				System.out.println("请输入两个乘数：");
				System.out.println(number.mul(input.nextDouble(), input.nextDouble()));
				break;
			case 4:
				System.out.println("请输入两个除数：");
				System.out.println(number.div(input.nextDouble(), input.nextDouble()));
				break;

			default:
				break;
			}
		}
	}
}
